<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    div {
      width: 100px;
      height: 100px;
      background: red;
    }
  
  </style>
</head>
<body>
  <div></div>
  <button>按钮</button>
  <script src="../libs/jquery-1.12.4.js"></script>
  <script>
    /* 
      $(dom).on('事件类型', function () {})

      如果一个元素上想要绑定多个事件
      $(dom).on({
        事件类型: function () {},
        事件类型n: function () {}
      })
    
      事件委托
      $(dom).on('事件类型', '子元素选择器', function () {})

      传参方式的改变
      
    
     */

    /* $('button').on('click', function () {

    }) */
    // 想要给div绑定 click 鼠标移入 移出 移动 事件
    /* $('div').on('click', function () {
      console.log('点击')
    }).on('mouseenter', function () {
      console.log('移入')
    }).on('mouseleave', function () {
      console.log('移出')
    }).on('mousemove', function () {
      console.log('移动')
    }) */
    $('div').on({
      click: function () {
        console.log('点击')
      },
      mouseenter: function () {
        console.log('移入')
      },
      mouseleave: function () {
        console.log('移出')
      },
      mousemove: function () {
        console.log('移动')
      }
    })
  </script>
</body>
</html>